<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="zh" xml:lang="zh" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Guideline: Message Attachments</title>
<meta name="uma.type" content="Guideline">
<meta name="uma.name" content="message_attachments">
<meta name="uma.presentationName" content="Message Attachments">
<meta name="element_type" content="other">
<meta name="filetype" content="description">
<meta name="role" content="">
<link rel="StyleSheet" href="./../../../css/default.css" type="text/css">
<script src="./../../../scripts/ContentPageResource.js" type="text/javascript" language="JavaScript"></script><script src="./../../../scripts/ContentPageSection.js" type="text/javascript" language="JavaScript"></script><script src="./../../../scripts/ContentPageSubSection.js" type="text/javascript" language="JavaScript"></script><script src="./../../../scripts/ContentPageToolbar.js" type="text/javascript" language="JavaScript"></script><script src="./../../../scripts/contentPage.js" type="text/javascript" language="JavaScript"></script><script type="text/javascript" language="JavaScript">
					var backPath = './../../../';
					var imgPath = './../../../images/';
					var nodeInfo=null;
					contentPage.preload(imgPath, backPath, nodeInfo,  '', false, false, false);
				</script>
</head>
<body>
<div id="breadcrumbs"></div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top"><a name="Top"></a>
<div id="page-guid" value="7.676056734461877E-306"></div>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td class="pageTitle" nowrap="true">Guideline: Message Attachments</td><td width="100%">
<div align="right" id="contentPageToolbar"></div>
</td><td width="100%" class="expandCollapseLink" align="right"><a name="mainIndex" href="./../../../index.htm"></a><script language="JavaScript" type="text/javascript" src="./../../../scripts/treebrowser.js"></script></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="pageTitleSeparator"><img src="./../../../images/shim.gif" alt="" title="" height="1"></td>
</tr>
</table>
<div class="overview">
<table width="97%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50"><img src="./../../../images/guidance.gif" alt="" title=""></td><td>
<table class="overviewTable" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">This guideline presents ways of dealing with the transmission of large or otherwise complex elements as attachments to messages by reference or containment, giving the designer the ability to satisfy performance or bandwidth constraints.</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="sectionHeading">Relationships</div>
<div class="sectionContent">
<table class="sectionTable" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<th class="sectionTableHeading" scope="row">Related Elements</th><td class="sectionTableCell">
<ul>
<li>
<a href="./../../../rup_soa_plugin/workproducts/soa_svce_model_message_BE931590.html" guid="{DD9F96C3-4D00-4441-951E-2674B9AEE1C6}">Message</a>
</li>
</ul>
</td>
</tr>
</table>
</div>
<div class="sectionHeading">Main Description</div>
<div class="sectionContent">
<table class="sectionTable" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td class="sectionTableSingleCell"><a id="XE_message_attachments__guidelines_for" name="XE_message_attachments__guidelines_for"></a> 
<h3>
    <a id="Introduction" name="Introduction">Introduction</a>
</h3>
<p>
    When designing <i><a class="elementLinkWithUserText" href="./../../../rup_soa_plugin/workproducts/soa_svce_model_message_BE931590.html" guid="{DD9F96C3-4D00-4441-951E-2674B9AEE1C6}">Messages</a></i>, there are occasionally structures that we find are
    actually realized as documents or other compound and potentially large files. For example, reports or product
    information may be distributed as PDF files or a message may have attached images describing a product or item. The
    <i><a class="elementLink" href="./../../../rup_soa_plugin/guidances/whitepapers/uml_profile_for_software_services_7ADFB3D2.html" guid="2.972928238097629E-306">Unified Modeling Language (UML) Profile for Software Services</a></i> provides an
    additional stereotype &lt;&lt;<i>Message Attachment</i>&gt;&gt; which can be attached to properties in a message model
    noting that the specified content is attached to the model in some way. This allows the designer to provide a detailed
    specification of a very important aspect of message design. In particular, in respect to performance and bandwidth
    usage, the passing of large binary attachments may be a significant factor.
</p>
<h4>
    Attachments or Links
</h4>
<p>
    In an Internet architecture, there is an approach to the transfer of large amounts of information, the passing of a URL
    that allows the recipient to download the content via a more appropriate protocol such as FTP. This is also very useful
    if the data does not change often because it can be placed in a common location for all clients to retrieve; it is also
    an efficient mechanism if the message recipient may chose not to download the additional content. This has the
    advantage of putting the requirement for attachment download on the client. This may more of a disadvantage and
    additional work for the client.
</p>
<p>
    Another possible approach for attachments is the <i>well known location</i>. For example, a part of the documentation
    of the service denotes a base URL for attachments and some element of the message denotes an identifier or file name
    that can be appended to the URL to get the actual resource to download.
</p>
<h4>
    Attachment Encoding
</h4>
<p>
    The message attachment stereotype also has a property that denotes the encoding form of the attachment. Although the
    name is the same as the property on a Message, it is recommended that the values used to denote the encoding for
    attachments be MIME types. These types are already used by certain Internet infrastructure such as the HTTP protocol in
    transferring binary data such as images for Web pages.
</p>
<p>
    For more information on MIME Types see the IETF RFC 2046 - <i><a href="http://ietf.org/rfc/rfc2046.txt">Multipurpose
    Internet Mail Extensions (MIME) Part Two: Media Types</a></i>.
</p>
<h3>
    <a id="Example" name="Example">An Example</a>
</h3>
<p>
    Let us consider a service that provides a product catalog. Obviously there are operations to find items, execute
    queries, and return complete product information. If we look at a subset of the model of the product data, we can see
    that each product entry has an associated image and possibly a zoomed-in image for easier viewing. In the model below,
    we can also see that the two images are marked as attachments to the product catalog data structure. What we cannot see
    in this diagram is that the value for the encoding property is "image/jpeg" in both cases.
</p>
<p align="center">
    <img height="96" alt="Diagram is described in the textual content." src="./../../../rup_soa_plugin/guidances/guidelines/resources/soa_msg_attachments-02.gif"     width="456" border="0" />
</p>
<p>
    As for the example shown above, it would be possible to send a URL for each image, allowing the client to decide if and
    when to download the actual image. The URL of course would denote the protocol and location for the download operation.
    The following is a version of the ProductCatalogData structure with the images as links.
</p>
<p align="center">
    <img height="88" alt="Diagram is described in the textual content." src="./../../../rup_soa_plugin/guidances/guidelines/resources/soa_msg_attachments-03.gif"     width="142" border="0" />
</p></td>
</tr>
</table>
</div>
<table class="copyright" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="copyright">Copyright &copy; 2008 版权所有 东软集团股份有限公司&nbsp; 联系邮箱:<a href="mailto:tcoe@neusoft.com">tcoe@neusoft.com</a></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
<script type="text/javascript" language="JavaScript">
				contentPage.onload();
			</script>
</html>
